1. Field of the Invention
The present invention relates to cache management and, more particularly, to a method and system for managing a cache of a server based on the levels of resources used to create dynamic content stored in the cache.
2. Description of the Related Art
Web pages or other computer pages that are created using variable data are known as “dynamic” pages. Generally, an application server on a network creates these dynamic pages by running programs such as Servlets. Each time a dynamic page is created, however, a significant amount of resources are used. Among the resources used, most page providers (e.g., website providers) are concerned with the monetary cost involved with generating a dynamic page. The generation cost of a dynamic page typically includes, but is not limited to, the cost of running the CPU (Central Processing Unit) on the application server, the cost of invoking EJB (Enterprise Java Bean) and JSP (Java Servlet Page) modules typically used to generate HTML file(s) corresponding to the page, and the network cost of invoking the application server and other processing devices. In most systems, the generation cost for a dynamic page can be rather high, which cost the page provider bears each time a dynamic page is created.
To reduce the costs associated with providing dynamic pages to users, it is common practice to store in a cache located on the application server some of the previously created dynamic pages that are frequently requested by the users. A cache is a temporary storage unit or location for temporarily storing previously created dynamic content such as dynamic pages, so that the application server need not recreate the same page each time a user requests it. However, not all previously created pages can be stored in the cache of the application server because the cache has limited memory space. To address this problem, certain criteria or page replacement methods may be used to determine which of the dynamically created pages should be “saved” in the cache for a subsequent use.
Several page replacement methods are known for managing the cache of an application server in a network environment. Among these methods, most frequently used are the Least Recently Used (LRU) method and the Hit Count method. In the LRU method, the system is configured to replace the least recently used pages stored in the cache with newly created pages. That is, the criteria used for replacing the cached pages is the time and date of the most recent access of the pages currently stored in the cache. In the Hit Count method, the system is configured to replace pages that are accessed less frequently. In other words, the cached pages are replaced based on how frequently the cached pages are accessed. These replacement methods, however, fail to consider the amount of resources used in, or page generation costs associated with, creating the cached pages. As a result, the prior art systems may replace a cached page with a new page even though it may be more expensive to recreate the cached page than to recreate the new page. Thus, the conventional cache management methods do not serve effectively the needs of page providers.
With the advent of personalized web pages and the growing number of business websites found on the web, the number of dynamic pages that are temporally stored or “cached” is growing at a fast rate. As the number of dynamic pages requiring complex back-end processing grows, the cache management methods for dynamic content become much more important because they can have a significant impact on the overall operation of the system. It is thus important to have a cache management system and method which can overcome the problems of conventional cache management methods and which can reduce the page provider's costs of providing dynamic pages to end-users.